<script type="text/javascript" src="<?php echo URL::base() . 'media/js/ckeditor/ckeditor.js' ?>"></script>
<script type="text/javascript" src="<?php echo URL::base() . 'media/js/admin.js' ?>"></script>
<script type="text/javascript">
    var alerts='<?php if (isset($error)) echo $error ?>';
    if(alerts!='') alert(alerts);
</script>
<div id="accordion">
    <h3><a href="#">Hírek intézése</a></h3>
    <div>
        <table id="admin_table" border="1">
            <th id="admin_th">Cím</th>
            <th id="admin_th" colspan="2"></th>
            <?php foreach ($news as $new) : ?>
                <tr>
                    <td class="admin_td"><?php echo $new->title ?></td>
                    <td class="admin_td"><a href="<?php echo Url::site('news/edit/' . $new->id, NULL, FALSE); ?>">Szerkesztés</a></td>
                    <td class="admin_td"><a href="<?php echo Url::site('news/delete/' . $new->id, NULL, FALSE); ?>">Törlés</a></td>
                </tr>
            <?php endforeach; ?>    
        </table>
        <a href="<?php echo Url::site('news/new', NULL, FALSE); ?>">Új hír</a>
    </div>

    <h3><a href="#">Találkozók intézése</a></h3>
    <div>
        <table id="admin_table" border="1">
            <th id="admin_th">Találkozó neve</th>
            <th id="admin_th" colspan="2"></th>
            <?php foreach ($meetings as $meeting) : ?>
                <tr>
                    <td class="admin_td"><?php echo $meeting->name ?></td>
                    <td class="admin_td"><a href="<?php echo Url::site('meetings/edit/' . $meeting->id, NULL, FALSE); ?>">Szerkesztés</a></td>
                    <td class="admin_td"><a href="<?php echo Url::site('meetings/delete/' . $meeting->id, NULL, FALSE); ?>">Törlés</a></td>
                </tr>
            <?php endforeach; ?>    
        </table>
        <a href="<?php echo Url::site('meetings/new', NULL, FALSE); ?>">Új találkozó</a>
        <fieldset>
            <legend>Aktuális találkozó: </legend>
            <?php echo form::open('meetings/selectactive') ?>
            <input type="radio" name="active" value="0" <?php if($no_meeting) echo 'checked' ?>/>Nincs<br/>
            <?php foreach ($active_meetings as $am): ?>
                <input type="radio" name="active" value="<?php echo $am->id ?>" <?php if ($am->active == 1) echo 'checked' ?> /><?php echo $am->name ?><br/>
            <?php endforeach ?>
            <?php echo form::submit('submit', 'Választ') ?>
            <?php echo form::close() ?>
        </fieldset>
    </div>

    <h3><a href="#">Feltöltés</a></h3>
    <div>
        <fieldset>
            <legend>Kategóriák</legend>
            <table id="admin_table" border="1">
                <th id="admin_th">Kategória neve</th>
                <th id="admin_th" colspan="2"></th>
                <?php foreach ($categories as $category): ?>
                    <tr>
                        <?php echo form::open('downloads/editcategory', array('id' => 'form_' . $category->id)) ?>
                        <?php echo form::hidden('id', $category->id) ?>
                        <td width="150" height="30">
                            <?php echo form::input('name', $category->name, array('class' => 'inputclass', 'id' => 'input_' . $category->id)) ?>
                            <?php echo form::label('name', $category->name, array('id' => 'label_' . $category->id, 'onClick' => 'change(' . $category->id . ')')) ?>
                        </td>
                        <td class="admin_td" height="30">
                    <center>
                        <a href="#" onClick="change(<?php echo $category->id ?>)" id="edit_<?php echo $category->id ?>">Szerkesztés</a>
                    </center>
                    </td>
                    <td  class="admin_td" height="30">
                    <center>
                        <a href="<?php echo URL::site('downloads/deletecategory', TRUE, FALSE) . '/' . $category->id ?>">Törlés</a>
                    </center>
                    </td>
                    </tr>
                    <?php echo form::close() ?>
                <?php endforeach; ?>
            </table>
        </fieldset>

        <?php echo $category_form ?>
        <?php echo $download_form ?>
        <?php echo $file_list ?>
    </div>

    <h3><a href="#">Statikus oldalak szerkesztése</a></h3>
    <div>
        <?php echo $page_form ?>
    </div>
</div>